<ion-view view-title="商品详情" class="productdetail">
	<!--一定要手动加导航栏-->
	<ion-nav-bar>
		<ion-nav-back-button>
		</ion-nav-back-button>
	</ion-nav-bar>
	<ion-nav-buttons side="right">
		<button class="button button-clear" style="display: flex;" on-tap="openModal_share()"><img src="./img/guilin/common/icon_share@2x.png" style="width: 20px;height: 20px;" /></button>
	</ion-nav-buttons>

	<ion-content class="has-footer bg">

		<!--描述：商品图片轮播-->
		<ion-slide-box delegate-handle="advs-handle" slide-interval="5000" show-pager="true">
			<ion-slide ng-repeat="img in detail.title_images">
				<img src="{{img.image.l_url}}" width="100%" />
			</ion-slide>
		</ion-slide-box>

		<div class="list list-borderless" ng-if="detail.name!=undefined">
			<li class="item">
				<p class="goodsName">{{detail.name}}</p>
				<!--价格的显示-->
				<div class="priceDiv">
					<span class="price" ng-show="!is_price&&detail.min_price&&detail.max_price">
						<span ng-show="detail.price_label_show=='true'" class="label">{{detail.price_flag=='0'?'商城价':detail.price_flag}}:</span>
						{{detail.min_price | currency:'￥'}}--{{detail.max_price | currency:'￥'}}
					</span>
					
					<span class="price" ng-show="!is_price&&!detail.min_price&&!detail.max_price">
						<span ng-show="detail.price_label_show=='true'" class="label">
							{{detail.price_flag=='0'?'商城价':detail.price_flag}}:
						</span>
						<span ng-show="detail.price || detail.price==0">
							{{detail.price | currency:'￥'}}
						</span>
						<span ng-show="!detail.price && detail.mktprice && detail.price!=0">
							{{detail.mktprice | currency:'￥'}}
						</span>
					</span>
					<!-- ng-show="detail.price!=detail.mktprice&&is_price"-->
					<span class="price" ng-show="is_price">
						<span ng-show="detail.price_flag" class="label">
							{{detail.price_flag=='0'?'商城价':detail.price_flag}}:
						</span>
						{{detail.price||detail.mktprice|currency:'￥'}}
						<span ng-show="detail.flag_name=='租赁'" class="label">/天</span>
					</span>
					
					<!--<span class="price" ng-show="detail.price==undefined&&is_price">
						{{detail.mktprice|currency:'￥'}}
						<span ng-show="detail.flag_name=='租赁'" class="label">/天</span>
					</span>-->

					<!--第二部分价格-->
					<div ng-if="detail.price_label_show=='true'">
						<span class="price" ng-show="detail.price!=detail.mktprice&&detail.mktprice&&detail.price!=undefined&&(!detail.min_price || !detail.max_price || is_price)">
							<span ng-show="detail.flag_name!='二手' && detail.flag_name!='滞销'&&detail.price_label_show=='true'" class="label">商城价:</span>
							<span ng-show="detail.flag_name=='二手' || detail.flag_name=='滞销'&&detail.price_label_show=='true'" class="label">原价:</span>
							{{detail.mktprice|currency:'￥'}}
						</span>
						
						<span class="price" ng-show="((detail.min_price!=detail.mktmin_price)&&(detail.max_price!=detail.mktmax_price))&&!is_price&&detail.mktmin_price&&detail.mktmax_price">
							<span ng-show="detail.flag_name!='二手' && detail.flag_name!='滞销'&&detail.price_label_show=='true'" class="label">商城价:</span>
							<span ng-show="detail.flag_name=='二手' || detail.flag_name=='滞销'&&detail.price_label_show=='true'" class="label">原价:</span>
							{{detail.mktmin_price | currency:'￥'}} --{{detail.mktmax_price | currency:'￥'}}
						</span>
					</div>
				</div>
				
				<div class="row commentRow">
					<div class="col col-33">评分：{{detail.avg_point}}</div>
					<div class="col col-33 text-center" ng-if="detail.product_display_rate==1">浏览：{{detail.click_count}}</div>
					<div class="col col-33 text-right" ng-if="detail.product_display_rate==2">月销量：{{detail.month_sell_count}}</div>
				</div>
			</li>
			
			<li class="item proItem" on-tap="openModal_coupon()" ng-if="detail.store_coupons">
				<div class="row padding-0">
					<div class="proTypeCol">
						<span class="proType">优惠券</span>
					</div>
					<div class="col padding-0 ellipsis">
						<span class="proName" ng-repeat="coupon in detail.store_coupons">{{coupon.name}}<span ng-if="!$last">，</span></span>
					</div>
					<div class="jtCol">
						<img class="jt" src="./img/guilin/common/icon_right@2x.png" />
					</div>
				</div>
			</li>
			
			<!--订单促销-->
			<li class="item proItem" ng-if="detail.store_pormotions">
				<div class="row padding-0">
					<div class="proTypeCol">
						<span class="proType">促销</span>
					</div>
					<div class="col padding-0" on-tap="showMoreProInfo(1)">
						<p class="proName" ng-repeat="pro in detail.store_pormotions" ng-if="$index<3||isMoreProInfo_order">
							{{pro.name}}
							<img src="{{$index==2&&!isMoreProInfo_order?'./img/guilin/common/icon_down@2x.png':'./img/guilin/common/icon_up@2x.png'}}" class="showMoreJt" ng-if="$index==2"/>
						</p>
					</div>
				</div>
			</li>
			
			<!--商品促销-->
			<li class="item proItem" ng-if="detail.promotion_info.promotionMsg">
				<div class="row padding-0">
					<div class="proTypeCol">
						<span class="proType">促销</span>
					</div>
					<div class="col padding-0" on-tap="showMoreProInfo(2)">
						<p class="proName" ng-repeat="pro in detail.promotion_info.promotionMsg" ng-if="$index<3||isMoreProInfo_goods">
							{{pro.name}}
							<img src="{{$index==2&&!isMoreProInfo_goods?'./img/guilin/common/icon_down@2x.png':'./img/guilin/common/icon_up@2x.png'}}" class="showMoreJt" ng-if="$index==2"/>
						</p>
					</div>
				</div>
			</li>
			
			<li class="item" style="margin-top: 10px;"></li>
			
			<!--选择型号-->
			<li class="item selectItem" ng-repeat="spec in detail.specification" on-tap="openModal_spec($index)">
				<div class="leftColor"></div><span ng-if="spec.checked">已选择</span>{{spec.name}}：{{spec.show_name}}
				<img class="jt" src="./img/guilin/common/icon_right@2x.png" />
			</li>
			
			<li class="item buyCountItem">
				<div class="leftColor"></div>
				<div class="left-zhang">
					<p class="countText">购买数量
						<span class='storeText' ng-if="minBuyNum>1 ">（  基数：<span class="num">{{minBuyNum}}</span>）</span>
					</p>
					<p class="storeText">库存：{{detail.store}}</p>
				</div>
				<div class="add stable-bg" on-tap="goods_add()" style="margin-right: 7px;">+</div>
				<input type="number" ng-model="input.goods_num" />
				<div class="add" on-tap="goods_reduce()">-</div>
			</li>
			
			<!--配件-->
			<li class="item pj" ng-if="detail.group[0].goods">
				配件推荐
			</li>
			<!--目前只有一个配件组-->
			<li class="item pjItem">
				<div class="pjDiv" ng-repeat="goods in detail.group[0].goods" ng-class="{'juli':$index%3==1}" on-tap="go_productdetail(goods.id)">
					<img src="{{goods.image?goods.image.s_url:noImg}}" width="100%" />
					<div class="textDiv">
						<p class="pjName">{{goods.name}}</p>
						<p class="gg">{{goods.spec_info?goods.spec_info:'暂无规格型号'}}</p>
						<p class="pjPrice">{{goods.group_price?goods.group_price:goods.mktprice|currency:'￥'}}</p>
						<p class="gg pjOrgPrice" ng-if="!goods.group_price">{{goods.mktprice|currency:'￥'}}</p>
					</div>
					<img class="checkIcon" src="{{goods.checked?'./img/guilin/common/icon_check_o@2x.png':'./img/guilin/common/icon_uncheck_o@2x.png'}}" on-tap="chooseSuitGoods($index,$event)"/>
				</div>
			</li>
			<li class="item selectItemPj" ng-if="detail.group[0].goods">
				当前选择了{{input.count}}件
				<span class="right-zhang">配件总价：<span style="color: rgb(254,97,25);">{{input.package_price|currency:'￥'}}</span></span>
				<p class="yh">优惠：{{input.preferential_price|currency:'￥'}}</p>
			</li>
			
			<!--店铺信息-->
			<li class="item storeItem item-input" on-tap="onshow_first()">
				<img src="{{detail.image_place1.s_url}}" class="storeImg" />
				<div class="storeMiddle level">
					<p class="storeName">{{detail.store_name}}</p>
					<span class="storeKind">{{detail.store_kind}}</span>
					<div class="shop_grade grade{{detail.store_level}}" style="margin-left: -5px;"></div>
				</div>
				<div class="storeRight">
					<p ng-repeat="store_info in detail.store_info">
						{{store_info.name}}<span class="point">{{store_info.avg_point}}</span>
					</p>
				</div>
			</li>
			
			<li class="item pullItem">
				<img src="./img/guilin/common/icon_up@2x.png" />
				上拉查看图文详情
			</li>
		</div>	
			
		<!--上拉跳转到商品详情-->
		<ion-infinite-scroll ng-if="!isLoad" immediate-check="false" on-infinite="doRefreshMore()" distance="3%"></ion-infinite-scroll>
	</ion-content>

	<!--底部购物车导航-->
	<div class="bar bar-footer" ng-show="detail.name!=undefined">
		<div ng-include="'templates/order/goods/shopcart_foot.html'" style="width: 100%;"></div>
	</div>

	<!--弹窗，通过点击控制，为了避免弹窗显示时，底部内容也能滚动，必须将这些弹窗放在ion-content外-->
	<div ng-if="isHide" class="kuang_zhang padding">
		<div ng-include="'templates/myrecord/keyshare.html'"></div>
	</div>

	<!--透明背景，当弹窗出现时，该背景也跟着出现，通过点击控制-->
	<div ng-if="isHide" class="touming_zhang" on-tap="hide_apply()"></div>

</ion-view>